import time
import unittest
from Page.page import PageBaidu
from selenium import webdriver

class TestBaiduSearch(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.maximize_window()
        self.driver.implicitly_wait(8)
        self.po = PageBaidu(self.driver)

    def tearDown(self):
        self.driver.quit()

    def test_search(self):

        self.po.searchyewu('洛杉矶暴乱')
        self.assertIn('洛杉矶暴乱', self.driver.title)

if __name__ == '__main__':
    unittest.main()